<?php $view->extend('Site1Bundle:Module:layout') ?>
        <table border="1">
            <thead>
                <th>
                    #
                </th>
                <?php foreach($module->getPlugins() as $plugin): ?>
                <th <?php echo \count($plugin->getFields()) > 1 ? 'colspan="' . \count($plugin->getFields()) .'"' : '';?>>
                    <?php echo $plugin->getTitle(); ?>
                </th>
                <?php endforeach; ?>
                <th>
                    <a href="<?php echo $view->router->generate('module_create'); ?>">Создать</a>
                </th>
            </thead>
            <tbody>
            <?php foreach($module->getKeys() as $id => $key) : ?>
                <tr>
                    <td><?php echo $id; ?></td>
                    <?php foreach($module->getPlugins() as $plugin): ?>
                         <?php foreach($plugin->getFields() as $field): ?>
                    <td>
                        <?php echo $field->getValue($id); ?>
                    </td>
                        <?php endforeach; ?>
                    <?php endforeach; ?>
                    <td>
                    <a href="<?php echo $view->router->generate('module_edit', array('id' => $key)); ?>">Редактировать</a>
                    <br />
                    <a href="<?php echo $view->router->generate('module_delete', array('id' => $key)); ?>">Удалить</a>
                    <br />
                <?php if(!$module->isHidden($id)) : ?>
                    <a href="<?php echo $view->router->generate('module_hide', array('id' => $key)); ?>">Скрыть</a>
                <?php else: ?>
                    <a href="<?php echo $view->router->generate('module_show', array('id' => $key)); ?>">Показать</a>
                    <?php endif;?>
                </td>
            <?php endforeach; ?>
            </tbody>
        </table>
